//
//  IdentityAlertViewCell.m
//  Peso Guide
//
//  Created by macbook on 2025/6/15.
//

#import "IdentityAlertViewCell.h"

@interface IdentityAlertViewCell ()

@property (nonatomic, strong) UILabel *titLabel;

@end

@implementation IdentityAlertViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titLabel = [PesoKit createLabelWithFrame:CGRectMake(12, 0, self.contentView.width, self.contentView.height) backGroundColor:ColorHex(@"#FFFFFF") text:@"" textColor:ColorHex(@"#0E1D31") font:FONT(FontWeightStyleRegular, 14)];
        [self.contentView addSubview:_titLabel];
        
        UIView *lineView = [PesoKit createViewWithFrame:CGRectMake(30, self.contentView.height-0.5, self.contentView.width-30*2, 0.5) backGroundColor:ColorHex(@"#EEEEEE")];
        [self.contentView addSubview:lineView];
    }
    return self;
}

- (void)setDataDic:(NSDictionary *)dataDic {
    _dataDic = dataDic;
    NSString *restriction = [NSString stringWithFormat:@"%@",[dataDic safeObjectForKey:@"restriction"]];
    NSString *isChoose = [NSString stringWithFormat:@"%@",[dataDic safeObjectForKey:@"isChoose"]];
    
    if (isChoose.boolValue == YES) {
        _titLabel.textColor = ColorHex(@"#1A7A35");
        _titLabel.font = FONT(FontWeightStyleMedium, 14);
    }else {
        _titLabel.textColor = ColorHex(@"#0E1D31");
        _titLabel.font = FONT(FontWeightStyleRegular, 14);
    }
    _titLabel.text = restriction;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
